<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/vectrics.tld"    prefix="vectrics" %>


<%@ page import="org.vectrics.security.*" %>
<%@ page import="org.vectrics.user.*" %>
<%@ page import="org.vectrics.struts.*" %>
<%
	Request vectricsRequest = HttpRequestConverter.convertRequest(request);

	Person authPerson = PrivilegeUtils.getAuthPerson(vectricsRequest);
	String companyPersonId = request.getParameter("companyPersonId");
	if ((companyPersonId == null) || (companyPersonId.length() == 0)) {
		companyPersonId = (String)request.getAttribute("companyPersonId");
	}
	
	String domainId = ThreadProperties.getDomain().getId().toString();
	
	String companyId = request.getParameter("companyId");
	String personId = request.getParameter("personId");
	if ((personId == null) || (personId.length() == 0)) {
		personId = (String)request.getAttribute("personId");
	}
%>


<%@page import="org.vectrics.hibernate.ThreadProperties"%><jsp:useBean id="companyPersonGroupForm" class="org.vectrics.company.web.struts.CompanyPersonGroupForm" scope="request"/>

<vectrics:errors debug="false"/>

<html:form action="/admin/company/person/group/save" method="POST"  focus="name">
	<html:hidden property="companyId"/>
	<html:hidden property="personId"/>
	<vectrics:userGroupSelect personId="<%=personId%>" domainId="<%=domainId%>" companyId="<%=companyId%>" hidden="true"/>

	<font><b>Company:</b>&nbsp<bean:write name="companyPersonGroupForm" property="companyName"/></font>
	<br>
	<font><b>Person:</b>&nbsp<bean:write name="companyPersonGroupForm" property="personName"/></font>
	<br>
	<table>
		<tr>
			<td class="formBg2" valign="top" width="150"><font class="formLabelClass"><bean:message key="prompt.user.roles"/></font></td>
			<td class="formBg2" valign="top"><vectrics:userGroupSelect personId="<%=personId%>" domainId="<%=domainId%>" companyId="<%=companyId%>" hidden="false"/></td>
			<td></td>
		</tr>
	
	
		<tr>
			<td valign="TOP" align="left"></td>
			<td valign="TOP" align="left">
				<vectrics:formButton code="button.ok" phraseCode="button.ok" 
					elementId="ok.btn"
					value="submit" name="submit"/>&nbsp;
				<vectrics:formButton code="button.cancel" phraseCode="button.cancel" 
					elementId="cancel.btn"
					value="cancel" name="cancel"/>
			</td>
		</tr>
	</table>
</html:form>
